import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)


// 路由
export const constantRoutes = [
  {
   path: '/index',
   component: (resolve) => require(['@/views/index'], resolve),
   meta:{
     title: '首页'
   }
  },
  {
   path: '',
   redirect: 'index',
   meta:{
     title: '首页'
   }
  },
  {
    path: '/register',
    component: (resolve) => require(['@/views/register'], resolve),
    meta:{
      title: '注册'
    }
  },
  {
    path: '/enterprise/bind',
    component: (resolve) => require(['@/views/enterprise/bind'], resolve),
    meta:{
      title: '绑定'
    }
  },
  {
    path: '/notice',
    component: (resolve) => require(['@/views/notice'], resolve),
    meta:{
      title: '公告通知'
    }
  },
  {
    path: '/notice/detail',
    component: (resolve) => require(['@/views/notice/detail'], resolve),
    meta:{
      title: '公告通知详情'
    }
  },
  {
    path: '/park/investment',
    component: (resolve) => require(['@/views/park/investment'], resolve),
    meta:{
      title: '园区招商'
    }
  },
  {
    path: '/park/settle',
    component: (resolve) => require(['@/views/park/settle'], resolve),
    meta:{
      title: '园区入驻'
    }
  },
  {
    path: '/park/list',
    component: (resolve) => require(['@/views/park/list'], resolve),
    meta:{
      title: '园区列表'
    }
  },
  {
    path: '/invitation/add',
    component: (resolve) => require(['@/views/invitation/add'], resolve),
    meta:{
      title: '添加访客邀请'
    }
  },
  {
    path: '/invitation/list',
    component: (resolve) => require(['@/views/invitation/list'], resolve),
    meta:{
      title: '访客邀请列表'
    }
  },
  {
    path: '/invitation/detail',
    component: (resolve) => require(['@/views/invitation/detail'], resolve),
    meta:{
      title: '查看访客邀请'
    }
  },
  {
    path: '/invitation/code',
    component: (resolve) => require(['@/views/invitation/code'], resolve),
    meta:{
      title: '访客邀请码'
    }
  }
]

export default new Router({
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
})
